//package com.hzncc.scaffold.controller.other;
//
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.web.bind.annotation.*;
//import javax.annotation.Resource;
//import java.util.List;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.hzncc.scaffold.core.ResultT;
//import com.hzncc.scaffold.service.TrainingprogramService;
//import com.hzncc.scaffold.entity.Other.Trainingprogram;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * <p>
// *  前端控制器
// * </p>
// *
// * @author DrunkBear
// * @since 2022-04-27
// */
//@RestController
//@RequestMapping("/trainingprogram")
//@Api(tags ="接口")
//public class TrainingprogramController {
//
//    @Resource
//    private TrainingprogramService trainingprogramService;
//
//    /**
//     * 查询表中所有信息
//     * @return
//     */
//    @GetMapping
//    @ApiOperation("查询所有中数据")
//    public ResultT findAll() {
//        return ResultT.success(trainingprogramService.list());
//    }
//
//    /**
//     * 根据Id查询表中数据
//     * @param id
//     * @return
//     */
//    @GetMapping("/{id}")
//    @ApiOperation("根据Id查询中数据")
//    public ResultT findOne(@PathVariable Integer id) {
//        return ResultT.success(trainingprogramService.getById(id));
//    }
//
//    /**
//     * 分页查询
//     * @param pageNum
//     * @param pageSize
//     * @return
//     */
//    @GetMapping("/page")
//    @ApiOperation("分页查询中数据")
//    public ResultT findPage(@RequestParam Integer pageNum,@RequestParam Integer pageSize) {
//        QueryWrapper<Trainingprogram> queryWrapper = new QueryWrapper<>();
//        return ResultT.success(trainingprogramService.page(new Page<>(pageNum, pageSize), queryWrapper));
//    }
//
//    /**
//     * 新增和更新接口
//     * @param
//     * @return
//     */
//    @PostMapping
//    @ApiOperation("新增或更新中数据")
//    public ResultT save(@RequestBody Trainingprogram trainingprogram) {
//        trainingprogramService.saveOrUpdate(trainingprogram);
//        return ResultT.success();
//    }
//
//    /**
//     * 根据Id删除表中数据
//     * @param id
//     * @return
//     */
//    @DeleteMapping("/{id}")
//    @ApiOperation("根据Id删除中数据")
//    public ResultT delete(@PathVariable Integer id) {
//        trainingprogramService.removeById(id);
//        return ResultT.success();
//    }
//
//    /**
//     * 批量删除表中数据
//     * @param ids
//     * @return
//     */
//    @PostMapping("/del/batch")
//    @ApiOperation("批量删除中数据")
//    public ResultT deleteBatch(@RequestBody List<Integer> ids) {
//        trainingprogramService.removeByIds(ids);
//        return ResultT.success();
//    }
//
//    @PostMapping("/queryByEntity")
//    @ApiOperation("条件查询")
//    public ResultT queryByEntity(Trainingprogram trainingprogram){
//        LambdaQueryWrapper<Trainingprogram> lqw = new LambdaQueryWrapper<>();
//        lqw.eq(trainingprogram.getId()!=null,Trainingprogram::getId,trainingprogram.getId());
//        lqw.eq(trainingprogram.getTitle()!=null,Trainingprogram::getTitle,trainingprogram.getTitle());
//        lqw.eq(trainingprogram.getCover()!=null,Trainingprogram::getCover,trainingprogram.getCover());
//        lqw.eq(trainingprogram.getEdPhase()!=null,Trainingprogram::getEdPhase,trainingprogram.getEdPhase());
//        lqw.eq(trainingprogram.getStatus()!=null,Trainingprogram::getStatus,trainingprogram.getStatus());
//        lqw.eq(trainingprogram.getMajorId()!=null,Trainingprogram::getMajorId,trainingprogram.getMajorId());
//        lqw.eq(trainingprogram.getPubTime()!=null,Trainingprogram::getPubTime,trainingprogram.getPubTime());
//        lqw.eq(trainingprogram.getContent()!=null,Trainingprogram::getContent,trainingprogram.getContent());
//        lqw.eq(trainingprogram.getStayAtTop()!=null,Trainingprogram::getStayAtTop,trainingprogram.getStayAtTop());
//        lqw.eq(trainingprogram.getSortTime()!=null,Trainingprogram::getSortTime,trainingprogram.getSortTime());
//        lqw.eq(trainingprogram.getIsDelete()!=null,Trainingprogram::getIsDelete,trainingprogram.getIsDelete());
//        lqw.eq(trainingprogram.getPublisherId()!=null,Trainingprogram::getPublisherId,trainingprogram.getPublisherId());
//
//        List<Trainingprogram> trainingprogramList = trainingprogramService.list(lqw);
//        return ResultT.success(trainingprogramList);
//    }
//}
